<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="{{url_for('static',filename='js/jquery.min.js')}}"></script>
    <script src="{{url_for('static',filename='js/bootstrap.min.js')}}"></script>
    <script src="{{url_for('static',filename='js/jquery.dataTables.min.js')}}"></script>
    <link rel="stylesheet" href="{{url_for('static',filename='css/jquery.dataTables.min.css')}}">
    <link rel="stylesheet" href="{{url_for('static',filename='css/bootstrap.min.css')}}">
    <title>实盘交易</title>
    <style>
    .button[disabled] {
        opacity: 0.6;
        cursor: not-allowed;
    }
    #block2{height:23px;width:500px;border:#ccc 1px solid;font-size:12px;text-align:center;overflow:hidden;}
    #block2 p{height:14px;}
    </style>

</head>
<body>
        <nav class="navbar navbar-default" role="navigation">
    <div class="container-fluid">
    <div class="navbar-header">
        <a class="navbar-brand" href="#">盯盘宝后台管理系统</a>
    </div>
    <div>
        <ul class="nav navbar-nav">
            <li ><a href="{{ url_for('start_web') }}">首页</a></li>
            <li ><a href="{{ url_for('permission_manage') }}">权限配置</a></li>
        </ul>
        <ul class="nav navbar-nav navbar-right">
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    管理员{{ session['admin'] if session['admin'] else "未登录" }}
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="{{ url_for("login_out") }}">退出</a></li>
                </ul>
            </li>
        </ul>
    </div>
    </div>
</nav>
<div id="all_content" style="margin:auto; width:80%">

<!--最上面放buton    -->
<div align="center">

    <div class="btn-group btn-group-lg" role="group" aria-label="...">

        <div class="btn-group" role="group">
        <button type="button" class="btn btn-success" onclick="simulateTradeRecords()">模拟交易记录</button>
        </div>

        <div class="btn-group" role="group">
        <button type="button" class="btn btn-success" onclick="tradeSystem()">实盘账户</button>
        </div>

        <div class="btn-group" role="group">
        <button type="button" class="btn btn-success" onclick="goToMonitor()">打开监控界面</button>
        </div>


        <div class="btn-group" role="group">
        <button type="button" class="btn btn-success" onclick="manualOperation()">人工操作</button>
        </div>

        <div class="btn-group" role="group">
        <button type="button" class="btn btn-success" onclick="historyProfit()">历史收益</button>
        </div>

        <div class="btn-group" role="group">
        <button type="button" class="btn btn-success" onclick="threadMonitor()">线程监控</button>
        </div>

        <div class="btn-group" role="group">
        <button type="button" class="btn btn-success" onclick="scheduleTask()">定时任务</button>
        </div>

        <div class="btn-group" role="group">
        <button type="button" class="btn btn-success" onclick="clientManage()">客户管理</button>
        </div>

        <div class="btn-group" role="group">
        <button type="button" class="btn btn-success" onclick="hotMatch()">热点匹配</button>
        </div>

        <div class="btn-group" role="group">
        <button type="button" class="btn btn-success" onclick="stockPool()">股票池</button>
        </div>

        <div class="btn-group" role="group">
        <button type="button" class="btn btn-success" onclick="ztReasonEditor()">涨停原因编辑</button>
        </div>

    </div>
</div>

<!--最上面放buton    -->
<div align="center">
<div id="block2" >
    <p>客户收益提醒:</p>
</div>
</div>

</div>

<script type="text/javascript">
    var obj=document.getElementById("block2");
    settime=0;
    var t=setInterval(rolltxt,300);
    function rolltxt(){
        obj.scrollTop+=1;
        if(obj.scrollTop==(obj.scrollHeight-obj.clientHeight)){
                obj.scrollTop=0;
            }
    }
    function simulateTradeRecords(){
        window.open("./simulateTrade");
    }

    function tradeSystem(){
        window.open("./tradeSystem");
    }

    function goToMonitor(){
        window.open("./monitor");
    }

    function manualOperation(){
        window.open("./manualOperation");
    }

    function historyProfit(){
        window.open("./historyProfit");
    }

    function threadMonitor(){
        window.open("./threadMonitor");
    }

    function scheduleTask(){
        window.open("./scheduleTask");
    }

    function clientManage(){
        window.open("./clientManage");
    }

    function hotMatch(){
        window.open("./hotMatch");
    }

    function stockPool(){
        window.open("./stockPool");
    }

    function ztReasonEditor(){
        window.open("./ztReasonEditor");
    }

function refreshAlertInfo(){
        $.ajax({
                url: '/alertInfo',
                async:true,
                success:function(result){
                    if (jQuery.type(result)=="string"){
                        var obj = JSON.parse(result);
                    }else{
                        var obj = result;
                    }
                    var alertInfo=obj.alertInfo;
                    var htmlStr = '';
                    for (var i=0;i<alertInfo.length;i++){
                        htmlStr += "<p>"+alertInfo[i]+"</p>";
                    }
                    $("#block2").append(htmlStr);
                }
            }
        );

}
jQuery(document).ready(function () {
    refreshAlertInfo();
    });
</script>
</body>
</html>

